Resource URL: /platform/<<version=1>>/job/jobs/<JID>

    Overview: This resource applies the standard collection pattern to
              individual jobs.  JID in the resource path is either a job
              instance ID or a job type; if job type is specified but multiple
              instances of that type exist, the request will fail.

     Methods: GET, PUT

********************************************************************************

Method GET: View a single job instance.

       URL: GET /platform/<<version=1>>/job/jobs/<JID>

There are no query arguments for this method.

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "jobs": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "properties": {
              "impact": {
                "enum": [
                  "Low", 
                  "Medium", 
                  "High", 
                  "Paused"
                ], 
                "type": "string", 
                "description": "The current impact of the job.", 
                "required": true
              }, 
              "paths": {
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Paths for which the job was queued."
              }, 
              "start_time": {
                "type": "integer", 
                "description": "The time the job started, in seconds since the Epoch."
              }, 
              "description": {
                "type": "string", 
                "description": "A text representation of the job."
              }, 
              "waiting_reason": {
                "enum": [
                  "blocked_by_priority"
                ], 
                "type": "string", 
                "description": "The reason the job is waiting."
              }, 
              "type": {
                "required": true, 
                "type": "string", 
                "description": "The job type."
              }, 
              "current_phase": {
                "type": "integer", 
                "description": "The current phase of the job."
              }, 
              "state": {
                "enum": [
                  "running", 
                  "paused_user", 
                  "paused_system", 
                  "paused_policy", 
                  "paused_priority", 
                  "cancelled_user", 
                  "cancelled_system", 
                  "failed", 
                  "succeeded", 
                  "unknown"
                ], 
                "type": "string", 
                "description": "Current state of the job.", 
                "required": true
              }, 
              "priority": {
                "required": true, 
                "minimum": 1, 
                "type": "integer", 
                "description": "Current priority of the job; lower numbers preempt higher numbers.", 
                "maximum": 10
              }, 
              "participants": {
                "items": {
                  "type": "integer"
                }, 
                "type": "array", 
                "description": "The set of devids working on the job."
              }, 
              "create_time": {
                "required": true, 
                "type": "integer", 
                "description": "The time the job was queued, in seconds since the epoch."
              }, 
              "end_time": {
                "type": "integer", 
                "description": "The time the job ended, in seconds since the Epoch."
              }, 
              "waiting_on": {
                "type": "integer", 
                "description": "The ID of a job for which this job is waiting."
              }, 
              "policy": {
                "required": true, 
                "type": "string", 
                "description": "Current impact policy of the job."
              }, 
              "progress": {
                "type": "string", 
                "description": "A text representation of the job's progress."
              }, 
              "retries_remaining": {
                "required": true, 
                "type": "integer", 
                "description": "The number of retries remaining if the job fails."
              }, 
              "total_phases": {
                "required": true, 
                "type": "integer", 
                "description": "The total number of phases of the job type."
              }, 
              "control_state": {
                "enum": [
                  "running", 
                  "paused_user", 
                  "paused_system", 
                  "paused_policy", 
                  "paused_priority", 
                  "cancelled_user", 
                  "cancelled_system", 
                  "failed", 
                  "succeeded", 
                  "unknown"
                ], 
                "type": "string", 
                "description": "State to which the job is transitioning; if control_state is identical to state, the job's state is stable.", 
                "required": false
              }, 
              "id": {
                "minimum": 1, 
                "type": "integer", 
                "description": "The ID of the job.", 
                "required": true
              }, 
              "running_time": {
                "type": "integer", 
                "description": "The number of seconds the job has executed."
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }
      }
    }
  ]
}

********************************************************************************

Method PUT: Modify a running or paused job instance.  All input fields are
            optional, but one or more must be supplied.

       URL: PUT /platform/<<version=1>>/job/jobs/<JID>

There are no query arguments for this method.

PUT request body schema:
{
  "type": "object", 
  "properties": {
    "policy": {
      "type": "string", 
      "description": "Impact policy of this job instance."
    }, 
    "priority": {
      "minimum": 1, 
      "type": "integer", 
      "description": "Priority of this job instance; lower numbers preempt higher numbers.", 
      "maximum": 10
    }, 
    "state": {
      "enum": [
        "run", 
        "pause", 
        "cancel"
      ], 
      "type": "string", 
      "description": "Desired new state of this job instance."
    }
  }
}

There is no JSON response body for this method.
